import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

export default new Router({
  mode: 'history',
  base: process.env.BASE_URL,
  routes: [
    {
      path: '/', redirect: '/login'
    },
    {
      path: '/login',
      name: 'login',
      // route level code-splitting
      // this generates a separate chunk (about.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import(/* webpackChunkName: "about" */ './views/Login.vue')
    },
    {
      path: '/main',
      name: 'main',
      // route level code-splitting
      // this generates a separate chunk (about.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import(/* webpackChunkName: "about" */ './views/Main.vue'),
      children: [
        {
          path: '/menu',
          name: 'menu',
          component: () => import('./views/sec/menu/Menu.vue')
        },
        {
          path: '/role',
          name: 'role',
          component: () => import('./views/sec/role/Role.vue')
        },
        {
          path: '/roleMenu',
          name: 'roleMenu',
          component: () => import('./views/sec/roleMenu/RoleMenu.vue')
        },
        {
            path: '/roleUser',
            name: 'roleUser',
            component: () => import('./views/sec/roleUser/RoleUser.vue')
        },
       {
          path: '/user',
          name: 'user',
          component: () => import('./views/sec/user/User.vue')
       },
      ]
    }
  ]
})
